<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
<link rel="shortcut icon" href="img/ic.png">
    <title>智能车测评展示系统</title>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <!-- Custom CSS -->
    <!-- Morris Charts CSS -->
    <link href="css/plugins/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="css/cdn/dataTables.bootstrap.css">
	<link rel="stylesheet" href="css/cdn/font_i0327076nave7b9.css">
    <link href="nuget/content/content/toastr.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="css/datatable.css"/>
    <link rel="stylesheet" type="text/css" href="css/Ranking.css"/>
    <style>
    	.panel-body{
	    	padding: 45px 50px ;
		}
		#example>thead{
			height: 0px;
		}
    </style>
</head>

<body>
	<div id="bg">
		<div class="panel-heading">
			<div class="login-logo">
				<img src="img/no/title.png" onclick="history.go(-1);"/>
			</div>
			<div class="login_logos">
				<ul class="btn_ul">
					<li class="active1"><img src="img/no/btn_blue_01.png"></li>
					<li class="active2"><img src="img/no/btn_white_02.png"></li>
					<li class="active3"><img src="img/no/btn_white_03.png"></li>
					<li class="active4"><img src="img/no/btn_white_04.png"></li>
				</ul>
			</div>
		</div>
		<div class="panel-body" id="active1" style="display: block;">
		    <table id="example" class="display" width="100%"></table>
		</div>
		<div class="panel-body" id="active2" style="display: none;">
		    <table id="examplea" class="display" width="100%"></table>
		</div>
		<div class="panel-body" id="active3" style="display: none;">
		    <table id="exampleb" class="display" width="100%"></table>
		</div>
		<div class="panel-body" id="active4" style="display: none;">
		    <table id="examplec" class="display" width="100%"></table>
		</div>
	</div>
    <!-- jQuery -->
    <script src="js/jquery.js"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>
	<!-- tab table-->
	<script src="js/cdn/jquery.dataTables.min.js"></script>
	<script src="js/cdn/dataTables.bootstrap.js"></script>
	<!-- device-->
	<script type="text/javascript" src="js/common.js" ></script>
	<script type="text/javascript" src="js/vue/vue.js" ></script>
	<script type="text/javascript" src="js/vue/vue-router.js" ></script>

	<script src="js/cdn/sockjs.min.js"></script>
	<script src="js/cdn/stomp.js"></script>

	<script>
		Vue.filter("timeChange", function(value) {
			return replaceTime(value / 1000);
		});
		var vue = new Vue({
		  el: '#bg',
		  data:{
		  	
		  },
		  mounted:function(){
		      var _self = this;
		      this.ready();

		      /* ajax init start */
		  	var zongchengji = function () {
				$.ajax({
                    url :url+'/users/'+adminId+'/stadiumResultDetails',
                    type : 'get',
                    dataType : 'json',
                    async: false,
                    beforeSend: function(request) {
                        request.setRequestHeader("accessToken", accessToken);
                    },
                    success : function(data) {
                        sessionStorage.setItem("ranking_all",JSON.stringify(data));
                        _self.deviceBasicId(data);
                    }
				})
            };
		  	var gaosuchengji = function () {
				$.ajax({
                    url :url+'/users/'+adminId+'/stadiumType/'+2+'/stadiumResultDetails',
                    type : 'get',
                    dataType : 'json',
                    async: false,
                    beforeSend: function(request) {
                        request.setRequestHeader("accessToken", accessToken);
                    },
                    success : function(data) {
                        sessionStorage.setItem("ranking_gaosu",JSON.stringify(data));
                        _self.stadiumTypea(data);
                    }
				})
            };
		  	var chengshichengji = function () {
				$.ajax({
                    url :url+'/users/'+adminId+'/stadiumType/'+1+'/stadiumResultDetails',
                    type : 'get',
                    dataType : 'json',
                    async: false,
                    beforeSend: function(request) {
                        request.setRequestHeader("accessToken", accessToken);
                    },
                    success : function(data) {
                        sessionStorage.setItem("ranking_chengshi",JSON.stringify(data));
                        _self.stadiumTypeb(data);
                    }
				})
            };
		  	var chengjiaochengji = function () {
				$.ajax({
                    url :url+'/users/'+adminId+'/stadiumType/'+3+'/stadiumResultDetails',
                    type : 'get',
                    dataType : 'json',
                    async: false,
                    beforeSend: function(request) {
                        request.setRequestHeader("accessToken", accessToken);
                    },
                    success : function(data) {
                        sessionStorage.setItem("ranking_chengjiao",JSON.stringify(data));
                        _self.stadiumTypeC(data);
                    }
				})
            };

              zongchengji();
              gaosuchengji();
              chengshichengji();
              chengjiaochengji();
              /* ajax init end */

              /* websocket stomp start */
              function connect() {
                  var socket = new SockJS(url + '/hello');
                  stompClient = Stomp.over(socket);
                  stompClient.connect({}, function (frame) {
                      // 总成绩
                      stompClient.subscribe('/topic/testStadiumResultSocketpush', function (result) {
                          var data = JSON.parse(result.body);
                          sessionStorage.setItem("ranking_all",JSON.stringify(data));
                          _self.deviceBasicId(data);
                      });
                      // 城市
                      stompClient.subscribe('/topic/testStadiumResult1Socketpush', function (result) {
                          var data = JSON.parse(result.body);
                          sessionStorage.setItem("ranking_chengshi",JSON.stringify(data));
                          _self.stadiumTypeb(data);
                      });
                      // 高速
                      stompClient.subscribe('/topic/testStadiumResul2Socketpush', function (result) {
                          var data = JSON.parse(result.body);
                          sessionStorage.setItem("ranking_gaosu",JSON.stringify(data));
                          _self.stadiumTypea(data);
                      });
                      // 城郊
                      stompClient.subscribe('/topic/testStadiumResul3Socketpush', function (result) {
                          var data = JSON.parse(result.body);
                          sessionStorage.setItem("ranking_chengjiao",JSON.stringify(data));
                          _self.stadiumTypeC(data);
                      });
                  });
              }
              connect();
              /* websocket stomp end */

		  },
		  methods:{
		  	ready:function(){
		  	    var _self = this;
				$('.active1').click(function(){
					$('.active1').find('img').attr('src','img/no/btn_blue_01.png'); 
					$('.active2').find('img').attr('src','img/no/btn_white_02.png'); 
					$('.active3').find('img').attr('src','img/no/btn_white_03.png'); 
					$('.active4').find('img').attr('src','img/no/btn_white_04.png');
					$("#active1").show();
					$("#active2").hide();
					$("#active3").hide();
					$("#active4").hide();

                    var str = sessionStorage.getItem("ranking_all");
                    if(str){
                        vue.deviceBasicId(JSON.parse(str));
					}
				});
				$('.active2').click(function(){
					$('.active1').find('img').attr('src','img/no/btn_white_01.png'); 
					$('.active2').find('img').attr('src','img/no/btn_blue_02.png'); 
					$('.active3').find('img').attr('src','img/no/btn_white_03.png');
                    $('.active4').find('img').attr('src','img/no/btn_white_04.png');
					$("#active1").hide();
					$("#active2").show();
					$("#active3").hide();
					$("#active4").hide();

                    var str = sessionStorage.getItem("ranking_gaosu");
                    if(str){
                        vue.stadiumTypea(JSON.parse(str));
                    }
				});
				$('.active3').click(function(){
					$('.active1').find('img').attr('src','img/no/btn_white_01.png'); 
					$('.active2').find('img').attr('src','img/no/btn_white_02.png'); 
					$('.active3').find('img').attr('src','img/no/btn_blue_03.png');
                    $('.active4').find('img').attr('src','img/no/btn_white_04.png');
					$("#active1").hide();
					$("#active2").hide();
					$("#active3").show();
					$("#active4").hide();

                    var str = sessionStorage.getItem("ranking_chengshi");
                    if(str){
                        vue.stadiumTypeb(JSON.parse(str));
                    }
				});
				$('.active4').click(function(){
					$('.active1').find('img').attr('src','img/no/btn_white_01.png');
					$('.active2').find('img').attr('src','img/no/btn_white_02.png');
					$('.active3').find('img').attr('src','img/no/btn_white_03.png');
                    $('.active4').find('img').attr('src','img/no/btn_blue_04.png');
					$("#active1").hide();
					$("#active2").hide();
					$("#active3").hide();
					$("#active4").show();

                    var str = sessionStorage.getItem("ranking_chengjiao");
                    if(str){
                        vue.stadiumTypeC(JSON.parse(str));
                    }
				});
		  	},
		  	//总成绩
		  	deviceBasicId:function(result){
		  		if(screen.width > 1366){
		  			var myTable = $('#example').DataTable({
					    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
			            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
			            "scrollY": "700px",
			            "scrollable":true,
			            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
			            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
			            "language": lang, //提示信息
			            "autoWidth": true, //自适应宽度，
			            "lengthMenu": [8, 30, 50],
			            "stripeClasses": ["odd", "even"], //为奇偶行加上样式，兼容不支持CSS伪类的场合
			            "showRowNumber":true,
			            "destroy":true,
			            "searching": false, //是否允许Datatables开启本地搜索
			            "paging": false, //是否开启本地分页
			            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
			            "info": false, //控制是否显示表格左下角的信息
			            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
			            "ordering": false,
			            "deferRender": true, //延迟渲染
			            //"ajax":"json/device.json",
                        "ajax": function (data, callback, settings) {
                            if (result['code'] == 1) {
                                if (result.result.length != 0) {
                                    var returnData = {};
                                    returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回
                                    returnData.recordsTotal = result.numReturn;//返回数据全部记录
                                    returnData.recordsFiltered = result.numReturn;//后台不实现过滤功能，每次查询均视作全部结果
                                    returnData.data = result.result;//返回的数据列表
                                    callback(returnData);
                                } else {
                                    $('#example').dataTable().fnClearTable();
                                }
                            } else {
                                ifajax(result);
                            }
                        },
				      "columns": [{ //定义列
					        "data":"riwso",
					        "width":"100px",
					        "render":function(data, type, full, meta ){
					        	if(meta.row == 0){
					        		return "<img src='img/no/NO_01.png'>"
					        	}
					        	if(meta.row == 1){
					        		return "<img src='img/no/NO_02.png'>"
					        	}
					        	if(meta.row == 2){
					        		return "<img src='img/no/NO_03.png'>"
					        	}
					        	return (meta.row+1);
					        },
					        "sTitle": "排名", //标题
					        "sDefaultContent": "", //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错  
					    },{
			                "data": "teamName",
			                "sTitle": "车队",
			                "width":"174px",
			                "sDefaultContent": "",
			            }, {
			                "data": "teamOrganization",
			                "sTitle": "参赛单位",
			                "width":"215px",
			                "sDefaultContent": "",
			            },{
			                "data": function(obj){
			                	if(obj.stadium2Time != null){
			                		//return obj.stadium2Time+'秒';
			                		return formatSeconds(obj.stadium2Time);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "高速时间",
			                "width":"293px",
			                "sDefaultContent": "",
			            },{
					      	"data":function(obj){
					            if(obj.stadium2Score != null){
			                		return obj.stadium2Score+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"高速成绩",
					      	"width":"293px",
					      	"sDefaultContent": "", 
					    },{
			                "data": function(obj){
					            if(obj.stadium1Time != null){
			                		return formatSeconds(obj.stadium1Time);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城区时间",
			                "width":"293px",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.stadium1Score != null){
			                		return obj.stadium1Score+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城区成绩",
					      	"width":"293px",
					      	"sDefaultContent": "", 
					    },{
                          "data": function(obj){
                              if(obj.stadium3Time != null){
                                  return formatSeconds(obj.stadium3Time);
                              }else{
                                  return ''
                              }
                          },
                          "sTitle": "城郊时间",
                          "width":"293px",
                          "sDefaultContent": "",
                      },{
                          "data": function(obj){
                              if(obj.stadium3Score != null){
                                  return obj.stadium3Score+'分';
                              }else{
                                  return ''
                              }
                          },
                          "sTitle":"城郊成绩",
                          "width":"293px",
                          "sDefaultContent": "",
                      },{
					      	"data": function(obj){
					            if(obj.totalScore != null){
			                		return '<span style="color:red">'+obj.totalScore+'分</span>';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"总成绩",
					      	"width":"202px",
					      	"sDefaultContent": "", 
					    }],
				    });
		  		}else{
		  			var myTable = $('#example').DataTable({
					    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
			            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
			            "scrollY": "400px",
			            "scrollable":true,
			            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
			            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
			            "language": lang, //提示信息
			            "autoWidth": true, //自适应宽度，
			            "lengthMenu": [8, 30, 50],
			            "stripeClasses": ["odd", "even"], //为奇偶行加上样式，兼容不支持CSS伪类的场合
			            "showRowNumber":true,
			            "destroy":true,
			            "searching": false, //是否允许Datatables开启本地搜索
			            "paging": false, //是否开启本地分页
			            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
			            "info": false, //控制是否显示表格左下角的信息
			            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
			            "ordering": false,
			            "deferRender": true, //延迟渲染
                        "ajax": function (data, callback, settings) {
                            if (result['code'] == 1) {
                                if (result.result.length != 0) {
                                    var returnData = {};
                                    returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回
                                    returnData.recordsTotal = result.numReturn;//返回数据全部记录
                                    returnData.recordsFiltered = result.numReturn;//后台不实现过滤功能，每次查询均视作全部结果
                                    returnData.data = result.result;//返回的数据列表
                                    callback(returnData);
                                } else {
                                    $('#example').dataTable().fnClearTable();
                                }
                            } else {
                                ifajax(result);
                            }
                        },
	
				      "columns": [{ //定义列
					        "data":"riwso",
					        "width":"100px",
					        "render":function(data, type, full, meta ){
					        	if(meta.row == 0){
					        		return "<img src='img/no/NO_01.png'>"
					        	}
					        	if(meta.row == 1){
					        		return "<img src='img/no/NO_02.png'>"
					        	}
					        	if(meta.row == 2){
					        		return "<img src='img/no/NO_03.png'>"
					        	}
					        	return (meta.row+1);
					        },
					        "sTitle": "排名", //标题
					        "sDefaultContent": "", //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错  
					    },{
			                "data": "teamName",
			                "sTitle": "车队",
			                "sDefaultContent": "",
			            }, {
			                "data": "teamOrganization",
			                "sTitle": "参赛单位",
			                "sDefaultContent": "",
			            },{
			                "data": function(obj){
			                	if(obj.stadium2Time != null){
			                		return formatSeconds(obj.stadium2Time);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "高速时间",
			                "sDefaultContent": "",
			            },{
					      	"data":function(obj){
					            if(obj.stadium2Score != null){
			                		return obj.stadium2Score+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"高速成绩",
					      	"sDefaultContent": "", 
					    },{
			                "data": function(obj){
					            if(obj.stadium1Time != null){
			                		return formatSeconds(obj.stadium1Time);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城区时间",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.stadium1Score != null){
			                		return obj.stadium1Score+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城区成绩",
					      	"sDefaultContent": "", 
					    },{
			                "data": function(obj){
					            if(obj.stadium3Time != null){
			                		return formatSeconds(obj.stadium3Time);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城郊时间",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.stadium3Score != null){
			                		return obj.stadium3Score+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城郊成绩",
					      	"sDefaultContent": "",
					    },{
					      	"data": function(obj){
					            if(obj.totalScore != null){
			                		return '<span style="color:red">'+obj.totalScore+'分</span>';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"总成绩",
					      	"sDefaultContent": ""
					    }]
				    });
		  		}
		  		
				
		  	},
		  	//高速赛道
		  	stadiumTypea:function(result){
		  		if(screen.width > 1366){
		  			var myTable = $('#examplea').DataTable({
					    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
			            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
			            "scrollY": "700px",
			            "scrollable":true,
			            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
			            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
			            "language": lang, //提示信息
			            "autoWidth": true, //自适应宽度，
			            "lengthMenu": [8, 30, 50],
			            "stripeClasses": ["odd", "even"], //为奇偶行加上样式，兼容不支持CSS伪类的场合
			            "showRowNumber":true,
			            "destroy":true,
			            "searching": false, //是否允许Datatables开启本地搜索
			            "paging": false, //是否开启本地分页
			            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
			            "info": false, //控制是否显示表格左下角的信息
			            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
			            "ordering": false,
			            "deferRender": true, //延迟渲染
                        "ajax": function (data, callback, settings) {
                            if (result['code'] == 1) {
                                if (result.result.length != 0) {
                                    var returnData = {};
                                    returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回
                                    returnData.recordsTotal = result.numReturn;//返回数据全部记录
                                    returnData.recordsFiltered = result.numReturn;//后台不实现过滤功能，每次查询均视作全部结果
                                    returnData.data = result.result;//返回的数据列表
                                    callback(returnData);
                                } else {
                                    $('#examplea').dataTable().fnClearTable();
                                }
                            } else {
                                ifajax(result);
                            }
                        },
	
				      	"columns": [{ //定义列
					        "data":"riwso",
					        "width":"50px",
					        "render":function(data, type, full, meta ){
					        	if(meta.row == 0){
					        		return "<img src='img/no/NO_01.png'>"
					        	}
					        	if(meta.row == 1){
					        		return "<img src='img/no/NO_02.png'>"
					        	}
					        	if(meta.row == 2){
					        		return "<img src='img/no/NO_03.png'>"
					        	}
					        	return (meta.row+1);
					        },
					        "sTitle": "排名", //标题
					        "sDefaultContent": "" //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错
					    },{
			                "data": "teamName",
			                "sTitle": "车队",
			                "width":"174px",
			                "sDefaultContent": ""
			            }, {
			                "data": "teamOrganization",
			                "sTitle": "参赛单位",
			                "width":"215px",
			                "sDefaultContent": ""
			            },{
			                "data": function(obj){
			                	if(obj.scenesScore != null){
			                		return obj.scenesScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "高速场景得分",
			                "width":"293px",
			                "sDefaultContent": ""
			            },{
					      	"data": function(obj){
					            if(obj.roadScore != null){
			                		return obj.roadScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"总路段得分",
					      	"width":"293px",
					      	"sDefaultContent": ""
					    },{
					      	"data":function(obj){
					            if(obj.timeScore != null){
			                		return obj.timeScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"高速时间得分",
					      	"width":"293px",
					      	"sDefaultContent": ""
					    },{
			                "data": function(obj){
					            if(obj.matchTime != null){
			                		return formatSeconds(obj.matchTime);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "高速比赛时间",
			                "width":"293px",
			                "sDefaultContent": ""
			            },{
					      	"data": function(obj){
					            if(obj.totalScore != null){
			                		return '<span style="color:red">'+obj.totalScore+'分</span>';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"高速比赛成绩",
					      	"width":"202px",
					      	"sDefaultContent": ""
					    }]
				    });
		  		}else{
		  			var myTable = $('#examplea').DataTable({
					    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
			            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
			            "scrollY": "400px",
			            "scrollable":true,
			            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
			            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
			            "language": lang, //提示信息
			            "autoWidth": true, //自适应宽度，
			            "lengthMenu": [8, 30, 50],
			            "stripeClasses": ["odd", "even"], //为奇偶行加上样式，兼容不支持CSS伪类的场合
			            "showRowNumber":true,
			            "destroy":true,
			            "searching": false, //是否允许Datatables开启本地搜索
			            "paging": false, //是否开启本地分页
			            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
			            "info": false, //控制是否显示表格左下角的信息
			            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
			            "ordering": false,
			            "deferRender": true, //延迟渲染
			            //"ajax":"json/device.json",
                        "ajax": function (data, callback, settings) {
                            if (result['code'] == 1) {
                                if (result.result.length != 0) {
                                    var returnData = {};
                                    returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回
                                    returnData.recordsTotal = result.numReturn;//返回数据全部记录
                                    returnData.recordsFiltered = result.numReturn;//后台不实现过滤功能，每次查询均视作全部结果
                                    returnData.data = result.result;//返回的数据列表
                                    callback(returnData);
                                } else {
                                    $('#examplea').dataTable().fnClearTable();
                                }
                            } else {
                                ifajax(result);
                            }
                        },
	
				      	"columns": [{ //定义列
					        "data":"riwso",
					        "width":"50px",
					        "render":function(data, type, full, meta ){
					        	if(meta.row == 0){
					        		return "<img src='img/no/NO_01.png'>"
					        	}
					        	if(meta.row == 1){
					        		return "<img src='img/no/NO_02.png'>"
					        	}
					        	if(meta.row == 2){
					        		return "<img src='img/no/NO_03.png'>"
					        	}
					        	return (meta.row+1);
					        },
					        "sTitle": "排名", //标题
					        "sDefaultContent": "", //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错  
					    },{
			                "data": "teamName",
			                "sTitle": "车队",
			                "sDefaultContent": "",
			            }, {
			                "data": "teamOrganization",
			                "sTitle": "参赛单位",
			                "sDefaultContent": "",
			            },{
			                "data": function(obj){
			                	if(obj.scenesScore != null){
			                		return obj.scenesScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "高速场景得分",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.roadScore != null){
			                		return obj.roadScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"总路段得分",
					      	"sDefaultContent": "", 
					    },{
					      	"data":function(obj){
					            if(obj.timeScore != null){
			                		return obj.timeScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"高速时间得分",
					      	"sDefaultContent": "", 
					    },{
			                "data": function(obj){
					            if(obj.matchTime != null){
			                		return formatSeconds(obj.matchTime);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "高速比赛时间",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.totalScore != null){
			                		return '<span style="color:red">'+obj.totalScore+'分</span>';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"高速比赛成绩",
					      	"sDefaultContent": "", 
					    }],
				    });
		  		}
		  		
				
		  	},
		  	//城市比赛
		  	stadiumTypeb:function(result){
		  		if(screen.width > 1366){
		  			var myTable = $('#exampleb').DataTable({
					    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
			            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
			            "scrollY": "700px",
			            "scrollable":true,
			            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
			            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
			            "language": lang, //提示信息
			            "autoWidth": true, //自适应宽度，
			            "lengthMenu": [8, 30, 50],
			            "stripeClasses": ["odd", "even"], //为奇偶行加上样式，兼容不支持CSS伪类的场合
			            "showRowNumber":true,
			            "destroy":true,
			            "searching": false, //是否允许Datatables开启本地搜索
			            "paging": false, //是否开启本地分页
			            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
			            "info": false, //控制是否显示表格左下角的信息
			            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
			            "ordering": false,
			            "deferRender": false, //延迟渲染
                        "ajax": function (data, callback, settings) {
                            if (result['code'] == 1) {
                                if (result.result.length != 0) {
                                    var returnData = {};
                                    returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回
                                    returnData.recordsTotal = result.numReturn;//返回数据全部记录
                                    returnData.recordsFiltered = result.numReturn;//后台不实现过滤功能，每次查询均视作全部结果
                                    returnData.data = result.result;//返回的数据列表
                                    callback(returnData);
                                } else {
                                    $('#exampleb').dataTable().fnClearTable();
                                }
                            } else {
                                ifajax(result);
                            }
                        },
						"columns": [{ //定义列
					        "data":"riwso",
					        "width":"50px",
					        "render":function(data, type, full, meta ){
					        	if(meta.row == 0){
					        		return "<img src='img/no/NO_01.png'>"
					        	}
					        	if(meta.row == 1){
					        		return "<img src='img/no/NO_02.png'>"
					        	}
					        	if(meta.row == 2){
					        		return "<img src='img/no/NO_03.png'>"
					        	}
					        	return (meta.row+1);
					        },
					        "sTitle": "排名", //标题
					        "sDefaultContent": "", //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错  
					    },{
			                "data": "teamName",
			                "sTitle": "车队",
			                "width":"174px",
			                "sDefaultContent": "",
			            }, {
			                "data": "teamOrganization",
			                "sTitle": "参赛单位",
			                "width":"215px",
			                "sDefaultContent": "",
			            },{
			                "data": function(obj){
			                	if(obj.scenesScore != null){
			                		return obj.scenesScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城市场景得分",
			                "width":"293px",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.roadScore != null){
			                		return obj.roadScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"总路段得分",
					      	"width":"202px",
					      	"sDefaultContent": "", 
					    },{
					      	"data":function(obj){
					            if(obj.timeScore != null){
			                		return obj.timeScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城市时间得分",
					      	"width":"293px",
					      	"sDefaultContent": "", 
					    },{
			                "data": function(obj){
					            if(obj.matchTime != null){
			                		return formatSeconds(obj.matchTime);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城市比赛时间",
			                "width":"293px",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.totalScore != null){
			                		return '<span style="color:red">'+obj.totalScore+'分</span>';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城市比赛成绩",
					      	"width":"202px",
					      	"sDefaultContent": "", 
					    }],
				    });
		  		}else{
		  			var myTable = $('#exampleb').DataTable({
					    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
			            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
			            "scrollY": "400px",
			            "scrollable":true,
			            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
			            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
			            "language": lang, //提示信息
			            "autoWidth": true, //自适应宽度，
			            "lengthMenu": [8, 30, 50],
			            "stripeClasses": ["odd", "even"], //为奇偶行加上样式，兼容不支持CSS伪类的场合
			            "showRowNumber":true,
			            "destroy":true,
			            "searching": false, //是否允许Datatables开启本地搜索
			            "paging": false, //是否开启本地分页
			            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
			            "info": false, //控制是否显示表格左下角的信息
			            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
			            "ordering": false,
			            "deferRender": true, //延迟渲染
                        "ajax": function (data, callback, settings) {
                            if (result['code'] == 1) {
                                if (result.result.length != 0) {
                                    var returnData = {};
                                    returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回
                                    returnData.recordsTotal = result.numReturn;//返回数据全部记录
                                    returnData.recordsFiltered = result.numReturn;//后台不实现过滤功能，每次查询均视作全部结果
                                    returnData.data = result.result;//返回的数据列表
                                    callback(returnData);
                                } else {
                                    $('#exampleb').dataTable().fnClearTable();
                                }
                            } else {
                                ifajax(result);
                            }
                        },
						"columns": [{ //定义列
					        "data":"riwso",
					        "width":"50px",
					        "render":function(data, type, full, meta ){
					        	if(meta.row == 0){
					        		return "<img src='img/no/NO_01.png'>"
					        	}
					        	if(meta.row == 1){
					        		return "<img src='img/no/NO_02.png'>"
					        	}
					        	if(meta.row == 2){
					        		return "<img src='img/no/NO_03.png'>"
					        	}
					        	return (meta.row+1);
					        },
					        "sTitle": "排名", //标题
					        "sDefaultContent": "", //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错  
					    },{
			                "data": "teamName",
			                "sTitle": "车队",
			                "sDefaultContent": "",
			            }, {
			                "data": "teamOrganization",
			                "sTitle": "参赛单位",
			                "sDefaultContent": "",
			            },{
			                "data": function(obj){
			                	if(obj.scenesScore != null){
			                		return obj.scenesScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城市场景得分",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.roadScore != null){
			                		return obj.roadScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"总路段得分",
					      	"sDefaultContent": "", 
					    },{
					      	"data":function(obj){
					            if(obj.timeScore != null){
			                		return obj.timeScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城市时间得分",
					      	"sDefaultContent": "", 
					    },{
			                "data": function(obj){
					            if(obj.matchTime != null){
			                		return formatSeconds(obj.matchTime);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城市比赛时间",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.totalScore != null){
			                		return '<span style="color:red">'+obj.totalScore+'分</span>';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城市比赛成绩",
					      	"sDefaultContent": "", 
					    }],
				    });
		  		}
		  		
				
		  	},
		    //城郊比赛
              stadiumTypeC:function(result){
		  		if(screen.width > 1366){
		  			var myTable = $('#examplec').DataTable({
					    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
			            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
			            "scrollY": "700px",
			            "scrollable":true,
			            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
			            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
			            "language": lang, //提示信息
			            "autoWidth": true, //自适应宽度，
			            "lengthMenu": [8, 30, 50],
			            "stripeClasses": ["odd", "even"], //为奇偶行加上样式，兼容不支持CSS伪类的场合
			            "showRowNumber":true,
			            "destroy":true,
			            "searching": false, //是否允许Datatables开启本地搜索
			            "paging": false, //是否开启本地分页
			            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
			            "info": false, //控制是否显示表格左下角的信息
			            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
			            "ordering": false,
			            "deferRender": false, //延迟渲染
                        "ajax": function (data, callback, settings) {
                            if (result['code'] == 1) {
                                if (result.result.length != 0) {
                                    var returnData = {};
                                    returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回
                                    returnData.recordsTotal = result.numReturn;//返回数据全部记录
                                    returnData.recordsFiltered = result.numReturn;//后台不实现过滤功能，每次查询均视作全部结果
                                    returnData.data = result.result;//返回的数据列表
                                    callback(returnData);
                                } else {
                                    $('#examplec').dataTable().fnClearTable();
                                }
                            } else {
                                ifajax(result);
                            }
                        },
						"columns": [{ //定义列
					        "data":"riwso",
					        "width":"50px",
					        "render":function(data, type, full, meta ){
					        	if(meta.row == 0){
					        		return "<img src='img/no/NO_01.png'>"
					        	}
					        	if(meta.row == 1){
					        		return "<img src='img/no/NO_02.png'>"
					        	}
					        	if(meta.row == 2){
					        		return "<img src='img/no/NO_03.png'>"
					        	}
					        	return (meta.row+1);
					        },
					        "sTitle": "排名", //标题
					        "sDefaultContent": "", //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错
					    },{
			                "data": "teamName",
			                "sTitle": "车队",
			                "width":"174px",
			                "sDefaultContent": "",
			            }, {
			                "data": "teamOrganization",
			                "sTitle": "参赛单位",
			                "width":"215px",
			                "sDefaultContent": "",
			            },{
			                "data": function(obj){
			                	if(obj.scenesScore != null){
			                		return obj.scenesScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城郊场景得分",
			                "width":"293px",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.roadScore != null){
			                		return obj.roadScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"总路段得分",
					      	"width":"202px",
					      	"sDefaultContent": "",
					    },{
					      	"data":function(obj){
					            if(obj.timeScore != null){
			                		return obj.timeScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城郊时间得分",
					      	"width":"293px",
					      	"sDefaultContent": "",
					    },{
			                "data": function(obj){
					            if(obj.matchTime != null){
			                		return formatSeconds(obj.matchTime);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城郊比赛时间",
			                "width":"293px",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.totalScore != null){
			                		return '<span style="color:red">'+obj.totalScore+'分</span>';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城郊比赛成绩",
					      	"width":"202px",
					      	"sDefaultContent": "",
					    }],
				    });
		  		}else{
		  			var myTable = $('#examplec').DataTable({
					    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
			            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
			            "scrollY": "400px",
			            "scrollable":true,
			            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
			            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
			            "language": lang, //提示信息
			            "autoWidth": true, //自适应宽度，
			            "lengthMenu": [8, 30, 50],
			            "stripeClasses": ["odd", "even"], //为奇偶行加上样式，兼容不支持CSS伪类的场合
			            "showRowNumber":true,
			            "destroy":true,
			            "searching": false, //是否允许Datatables开启本地搜索
			            "paging": false, //是否开启本地分页
			            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
			            "info": false, //控制是否显示表格左下角的信息
			            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
			            "ordering": false,
			            "deferRender": true, //延迟渲染
                        "ajax": function (data, callback, settings) {
                            if (result['code'] == 1) {
                                if (result.result.length != 0) {
                                    var returnData = {};
                                    returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回
                                    returnData.recordsTotal = result.numReturn;//返回数据全部记录
                                    returnData.recordsFiltered = result.numReturn;//后台不实现过滤功能，每次查询均视作全部结果
                                    returnData.data = result.result;//返回的数据列表
                                    callback(returnData);
                                } else {
                                    $('#examplec').dataTable().fnClearTable();
                                }
                            } else {
                                ifajax(result);
                            }
                        },
						"columns": [{ //定义列
					        "data":"riwso",
					        "width":"50px",
					        "render":function(data, type, full, meta ){
					        	if(meta.row == 0){
					        		return "<img src='img/no/NO_01.png'>"
					        	}
					        	if(meta.row == 1){
					        		return "<img src='img/no/NO_02.png'>"
					        	}
					        	if(meta.row == 2){
					        		return "<img src='img/no/NO_03.png'>"
					        	}
					        	return (meta.row+1);
					        },
					        "sTitle": "排名", //标题
					        "sDefaultContent": "", //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错
					    },{
			                "data": "teamName",
			                "sTitle": "车队",
			                "sDefaultContent": "",
			            }, {
			                "data": "teamOrganization",
			                "sTitle": "参赛单位",
			                "sDefaultContent": "",
			            },{
			                "data": function(obj){
			                	if(obj.scenesScore != null){
			                		return obj.scenesScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城郊场景得分",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.roadScore != null){
			                		return obj.roadScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"总路段得分",
					      	"sDefaultContent": "",
					    },{
					      	"data":function(obj){
					            if(obj.timeScore != null){
			                		return obj.timeScore+'分';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城郊时间得分",
					      	"sDefaultContent": "",
					    },{
			                "data": function(obj){
					            if(obj.matchTime != null){
			                		return formatSeconds(obj.matchTime);
			                	}else{
			                		return ''
			                	}
					        },
			                "sTitle": "城郊比赛时间",
			                "sDefaultContent": "",
			            },{
					      	"data": function(obj){
					            if(obj.totalScore != null){
			                		return '<span style="color:red">'+obj.totalScore+'分</span>';
			                	}else{
			                		return ''
			                	}
					        },
					      	"sTitle":"城郊比赛成绩",
					      	"sDefaultContent": "",
					    }],
				    });
		  		}


		  	},
		  }
		});

	</script>
</body>

</html>
